cd /root/testjdemo/
containerName=testj
imgName=testjimg
CID=$(docker ps -a| grep "${containerName}" | awk '{print $1}')
echo $CID
if [ "$CID" != "" ];then
    docker stop ${containerName}
    docker rm ${containerName}
    docker rmi ${imgName}
    echo "重置CID"
#docker stop $CID
#docker rm $CID
fi

docker build -t ${imgName} .

# Development(开发),、Staging(分阶段), 和 Production(生产)
docker run --name ${containerName} -p 5055:80 -d ${imgName} -e ASPNETCORE_ENVIRONMENT=Production

echo "5055"
